home *** CD-ROM | disk | FTP | other *** search
- /*
- File: TEnvironment.h
-
- Contains:
-
- Written by: Arno Gourdol
-
- Copyright: © 1996 by Apple Computer, Inc., all rights reserved.
-
- */
-
- #include <Types.h>
- #include <Gestalt.h>
-
- #include "CRect.h"
-
- class TEnvironment
- {
- public:
- TEnvironment(void);
- ~TEnvironment() {};
-
- inline Boolean HasGestaltAttribute(OSType selector, UInt32 attribute);
-
- Boolean HasColorQuickdraw(void);
- Boolean HasAppleEvent(void);
- Boolean HasGestalt(void);
- Boolean HasExtendedDITL(void);
-
- void GetMonitorRect(const CRect& r,
- CRect& monitor); // Returns the monitor rectangle covering most of r
- void GetMainScreenRect(CRect& theMainScreenRect);// Returns the rectangle of the main screen
- Boolean IsSystemScriptRTL(void);
-
- private:
- enum Tristate {triTrue, triFalse, triUnknown};
- UniversalProcPtr fUnimplementedTrapAddress;
-
- Tristate fHasColorQuickdraw;
- Tristate fHasAppleEvent;
- Tristate fHasGestalt;
- Tristate fHasExtendedDITL;
- Tristate fSystemScriptIsRTL;
- };
-
-
- Boolean TEnvironment::HasGestaltAttribute(OSType selector, UInt32 attribute)
- {
- SInt32 response;
-
- return (::Gestalt(selector, &response) == noErr) &&
- ((response & (1L << attribute)) != 0);
- }
-